package com.jetpackframework;

import android.content.Context;

import com.gwm.annotation.layout.IOCWork;
import com.gwm.annotation.router.Module;
import com.jetpackframework.applicationdelegate.BaseApplication;
import com.jetpackframework.routerview.RouterViewLoader;

@IOCWork(Application.PROJECT_NAME)
@Module(Application.PROJECT_NAME)
public final class Application extends BaseApplication {
    public static final String PROJECT_NAME = "frameworkx";
    private MergeApplicationDelegate delegate;
    private static Application instance;

    public static Application getInstance() {
        return instance;
    }

    @Override
    protected void attachBaseContext(Context base) {
        instance = this;
        super.attachBaseContext(base);
    }

    @Override
    protected com.jetpackframework.applicationdelegate.ApplicationDelegate createApplicationDelegate() {
        delegate = new MergeApplicationDelegate();
        return delegate;
    }

    public MergeApplicationDelegate getDelegate(){
        return delegate;
    }

    public RouterViewLoader getRouterViewLoader() {
        return delegate.getRouterViewLoader();
    }
}